var account_add = JSON.parse(window.session_storage.getItem('account_add'));
console.log(account_add)
   if (account_add!==null ) {
           var role_name = JSON.parse(sessionStorage.getItem("roleNameArr"));
           var role_id = JSON.parse(sessionStorage.getItem("roleIdArr"));
           var account_add = JSON.parse(window.session_storage.getItem('account_add'));
           var roleHtmlStr = "";
           var roleIdStr = "";
           for (var i = 0; i < role_name.length; i++) {
               roleHtmlStr += role_name[i] + " ";
           }
           for (var i = 0; i < role_id.length; i++) {
               roleIdStr += role_id[i] + " ";
           }
           $(".roleName").html(roleIdStr);
           $(".roleName").html(roleHtmlStr);
           var enter_time = get_time();
           var NAME = $('#NAME').val(account_add.NAME);
           var NUMBER = $('#NUMBER').val(account_add.NUMBER);
           var ENTRY_TIME = $('#ENTRY_TIME').val(account_add.ENTRY_TIME);
           var USERNAME = $('#USERNAME').val(account_add.USERNAME);
           var PHONE = $('#PHONE').val(account_add.PHONE);
           var EMAIL = $('#EMAIL').val(account_add.EMAIL);
           var DEPARTMENT_NAME = $('#DEPARTMENT_NAME').val(account_add.DEPARTMENT_NAME);
           var BIANMA = $('#BIANMA').val(account_add.BIANMA);
           var PASSWORD = $('#PASSWORD').val(account_add.PASSWORD);
           var STATE = $('#STATE').val(account_add.STATE);
           if (user_editData.STATE == 0) {
               $("#STATUS").prop("checked", true)
           } else {
               $("#STATUS").prop("checked", false)
           }
           $("#accounts").validate({
               rules: {
                   NAME: {
                       required: true,
                       minlength: 2,
                       maxlength: 20
                   },
                   NUMBER: {
                       required: true,
                       isDigits: true,
                       minlength: 12,
                       maxlength: 12
                   },
                   ENTRY_TIME: {
                       required: true,
                   },
                   USERNAME: {
                       required: true,
                       isUserName: true,
                   },
                   PASSWORD: {
                       required: true,
                       minlength: 8,
                       maxlength: 16
                   },
                   PHONE: {
                       required: true,
                       isMobile: true,
                   },
                   EMAIL: {
                       email: true,
                   },
                   BIANMA: {
                       isDigits: true,
                       maxlength: 22
                   },
               },
               onkeyup: false,
               focusCleanup: true,
               success: "valid",
               submitHandler: function (form) {
                   var accountStatus;
                   if ($("#STATUS")[0].checked == true) {
                       accountStatus = 0;
                   } else {
                       accountStatus = 1;
                   }
                   $(form).ajaxSubmit({
                       type: 'post',
                       url: root.accessInter.access_user_saveUApi,
                       data: {
                           NUMBER: $('#NUMBER').val(), //工号
                           NAME: $('#NAME').val(),  //  姓名
                           USERNAME: $('#USERNAME').val(),       //  账号
                           PASSWORD: $('#PASSWORD').val(),     //  密码
                           PHONE: $('#PHONE').val(),        //  电话
                           EMAIL: $('#EMAIL').val(),        //  邮箱
                           ROLE_ID: sessionStorage.getItem("roleIdArr"),       //  角色
                           BIANMA: $('#BIANMA').val(),
                           STATUS: accountStatus //  状态
                       },  //传入组装的参数
                       success: function (data) {
                           switch (data.code) {
                               case 200:
                                   layer.msg(data.data.errors[0], {icon: 1, time: 1000});
                                   window.session_storage.setItem('account_add','');
                                   window.session_storage.setItem('user_editDataAdd','');
                                   var index = parent.location.reload();
                                   parent.layer.close(index);
                               case 400:
                                   layer.msg(data.data.errors[0], {icon: 1, time: 1000});
                               case 404:
                                   layer.msg(data.data.errors[0], {icon: 1, time: 1000});
                           }
                       },
                   });
               }
           });
  }
//----------------------------------------------------------------------------------------------------------------------
